﻿using APP.HELPER.Data.Helper;
using System; using Extra.ERP;
using System.ComponentModel;
using System.Data.SqlClient;

namespace HRM.CORE
{
    public class HRM_CANDIDATE_RATE
    {
        private string m_CandidateCode;
        private string m_Communicate;
        private DateTime m_Date;
        private string m_Experience;
        private string m_Health;
        private string m_Information;
        private bool m_IsPass;
        private string m_Knowledge;
        private string m_Lead;
        private string m_Look;
        private double m_Mark;
        private string m_Person;
        private string m_Position;
        private string m_Proposal;
        private string m_Rate;
        private Guid m_RateID;
        private string m_Situation;
        private string m_Solve;
        private string m_Style;
        private string m_Team;
        private string m_Voice;

        public HRM_CANDIDATE_RATE()
        {
            this.m_RateID = Guid.Empty;
            this.m_CandidateCode = "";
            this.m_Person = "";
            this.m_Date = DateTime.Now;
            this.m_Position = "";
            this.m_Look = "";
            this.m_Style = "";
            this.m_Voice = "";
            this.m_Health = "";
            this.m_Knowledge = "";
            this.m_Experience = "";
            this.m_Communicate = "";
            this.m_Solve = "";
            this.m_Team = "";
            this.m_Situation = "";
            this.m_Lead = "";
            this.m_Information = "";
            this.m_Rate = "";
            this.m_Proposal = "";
            this.m_Mark = 0.0;
            this.m_IsPass = true;
        }

        public HRM_CANDIDATE_RATE(Guid RateID, string CandidateCode, string Person, DateTime Date, string Position, string Look, string Style, string Voice, string Health, string Knowledge, string Experience, string Communicate, string Solve, string Team, string Situation, string Lead, string Information, string Rate, string Proposal, double Mark, bool IsPass)
        {
            this.m_RateID = RateID;
            this.m_CandidateCode = CandidateCode;
            this.m_Person = Person;
            this.m_Date = Date;
            this.m_Position = Position;
            this.m_Look = Look;
            this.m_Style = Style;
            this.m_Voice = Voice;
            this.m_Health = Health;
            this.m_Knowledge = Knowledge;
            this.m_Experience = Experience;
            this.m_Communicate = Communicate;
            this.m_Solve = Solve;
            this.m_Team = Team;
            this.m_Situation = Situation;
            this.m_Lead = Lead;
            this.m_Information = Information;
            this.m_Rate = Rate;
            this.m_Proposal = Proposal;
            this.m_Mark = Mark;
            this.m_IsPass = IsPass;
        }

        public string Get(string CandidateCode)
        {
            string str = "";
            string[] myParams = new string[] { "@CandidateCode" };
            object[] myValues = new object[] { CandidateCode };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_CANDIDATE_RATE_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_RateID = reader.GetGuid(reader.GetOrdinal("RateID"));
                    this.m_CandidateCode = Convert.ToString(reader["CandidateCode"]);
                    this.m_Person = Convert.ToString(reader["Person"]);
                    this.m_Date = Convert.ToDateTime(reader["Date"]);
                    this.m_Position = Convert.ToString(reader["Position"]);
                    this.m_Look = Convert.ToString(reader["Look"]);
                    this.m_Style = Convert.ToString(reader["Style"]);
                    this.m_Voice = Convert.ToString(reader["Voice"]);
                    this.m_Health = Convert.ToString(reader["Health"]);
                    this.m_Knowledge = Convert.ToString(reader["Knowledge"]);
                    this.m_Experience = Convert.ToString(reader["Experience"]);
                    this.m_Communicate = Convert.ToString(reader["Communicate"]);
                    this.m_Solve = Convert.ToString(reader["Solve"]);
                    this.m_Team = Convert.ToString(reader["Team"]);
                    this.m_Situation = Convert.ToString(reader["Situation"]);
                    this.m_Lead = Convert.ToString(reader["Lead"]);
                    this.m_Information = Convert.ToString(reader["Information"]);
                    this.m_Rate = Convert.ToString(reader["Rate"]);
                    this.m_Proposal = Convert.ToString(reader["Proposal"]);
                    this.m_Mark = Convert.ToDouble(reader["Mark"]);
                    this.m_IsPass = Convert.ToBoolean(reader["IsPass"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Update()
        {
            string[] myParams = new string[] { 
                "@RateID", "@CandidateCode", "@Person", "@Date", "@Position", "@Look", "@Style", "@Voice", "@Health", "@Knowledge", "@Experience", "@Communicate", "@Solve", "@Team", "@Situation", "@Lead", 
                "@Information", "@Rate", "@Proposal", "@Mark", "@IsPass"
             };
            object[] myValues = new object[] { 
                this.m_RateID, this.m_CandidateCode, this.m_Person, this.m_Date, this.m_Position, this.m_Look, this.m_Style, this.m_Voice, this.m_Health, this.m_Knowledge, this.m_Experience, this.m_Communicate, this.m_Solve, this.m_Team, this.m_Situation, this.m_Lead, 
                this.m_Information, this.m_Rate, this.m_Proposal, this.m_Mark, this.m_IsPass
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_CANDIDATE_RATE_Update", myParams, myValues);
        }

        public string Update(Guid RateID, string CandidateCode, string Person, DateTime Date, string Position, string Look, string Style, string Voice, string Health, string Knowledge, string Experience, string Communicate, string Solve, string Team, string Situation, string Lead, string Information, string Rate, string Proposal, double Mark, bool IsPass)
        {
            string[] myParams = new string[] { 
                "@RateID", "@CandidateCode", "@Person", "@Date", "@Position", "@Look", "@Style", "@Voice", "@Health", "@Knowledge", "@Experience", "@Communicate", "@Solve", "@Team", "@Situation", "@Lead", 
                "@Information", "@Rate", "@Proposal", "@Mark", "@IsPass"
             };
            object[] myValues = new object[] { 
                RateID, CandidateCode, Person, Date, Position, Look, Style, Voice, Health, Knowledge, Experience, Communicate, Solve, Team, Situation, Lead, 
                Information, Rate, Proposal, Mark, IsPass
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_CANDIDATE_RATE_Update", myParams, myValues);
        }

        public string Update(SqlConnection myConnection, Guid RateID, string CandidateCode, string Person, DateTime Date, string Position, string Look, string Style, string Voice, string Health, string Knowledge, string Experience, string Communicate, string Solve, string Team, string Situation, string Lead, string Information, string Rate, string Proposal, double Mark, bool IsPass)
        {
            string[] myParams = new string[] { 
                "@RateID", "@CandidateCode", "@Person", "@Date", "@Position", "@Look", "@Style", "@Voice", "@Health", "@Knowledge", "@Experience", "@Communicate", "@Solve", "@Team", "@Situation", "@Lead", 
                "@Information", "@Rate", "@Proposal", "@Mark", "@IsPass"
             };
            object[] myValues = new object[] { 
                RateID, CandidateCode, Person, Date, Position, Look, Style, Voice, Health, Knowledge, Experience, Communicate, Solve, Team, Situation, Lead, 
                Information, Rate, Proposal, Mark, IsPass
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_CANDIDATE_RATE_Update", myParams, myValues);
        }

        public string Update(SqlTransaction myTransaction, Guid RateID, string CandidateCode, string Person, DateTime Date, string Position, string Look, string Style, string Voice, string Health, string Knowledge, string Experience, string Communicate, string Solve, string Team, string Situation, string Lead, string Information, string Rate, string Proposal, double Mark, bool IsPass)
        {
            string[] myParams = new string[] { 
                "@RateID", "@CandidateCode", "@Person", "@Date", "@Position", "@Look", "@Style", "@Voice", "@Health", "@Knowledge", "@Experience", "@Communicate", "@Solve", "@Team", "@Situation", "@Lead", 
                "@Information", "@Rate", "@Proposal", "@Mark", "@IsPass"
             };
            object[] myValues = new object[] { 
                RateID, CandidateCode, Person, Date, Position, Look, Style, Voice, Health, Knowledge, Experience, Communicate, Solve, Team, Situation, Lead, 
                Information, Rate, Proposal, Mark, IsPass
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_CANDIDATE_RATE_Update", myParams, myValues);
        }

        [Category("Column"), DisplayName("CandidateCode")]
        public string CandidateCode
        {
            get
            {
                return this.m_CandidateCode;
            }
            set
            {
                this.m_CandidateCode = value;
            }
        }

        [Category("Column"), DisplayName("Communicate")]
        public string Communicate
        {
            get
            {
                return this.m_Communicate;
            }
            set
            {
                this.m_Communicate = value;
            }
        }

        [Category("Column"), DisplayName("Date")]
        public DateTime Date
        {
            get
            {
                return this.m_Date;
            }
            set
            {
                this.m_Date = value;
            }
        }

        [Category("Column"), DisplayName("Experience")]
        public string Experience
        {
            get
            {
                return this.m_Experience;
            }
            set
            {
                this.m_Experience = value;
            }
        }

        [DisplayName("Health"), Category("Column")]
        public string Health
        {
            get
            {
                return this.m_Health;
            }
            set
            {
                this.m_Health = value;
            }
        }

        [DisplayName("Information"), Category("Column")]
        public string Information
        {
            get
            {
                return this.m_Information;
            }
            set
            {
                this.m_Information = value;
            }
        }

        [DisplayName("IsPass"), Category("Column")]
        public bool IsPass
        {
            get
            {
                return this.m_IsPass;
            }
            set
            {
                this.m_IsPass = value;
            }
        }

        [Category("Column"), DisplayName("Knowledge")]
        public string Knowledge
        {
            get
            {
                return this.m_Knowledge;
            }
            set
            {
                this.m_Knowledge = value;
            }
        }

        [Category("Column"), DisplayName("Lead")]
        public string Lead
        {
            get
            {
                return this.m_Lead;
            }
            set
            {
                this.m_Lead = value;
            }
        }

        [DisplayName("Look"), Category("Column")]
        public string Look
        {
            get
            {
                return this.m_Look;
            }
            set
            {
                this.m_Look = value;
            }
        }

        [Category("Column"), DisplayName("Mark")]
        public double Mark
        {
            get
            {
                return this.m_Mark;
            }
            set
            {
                this.m_Mark = value;
            }
        }

        [Category("Column"), DisplayName("Person")]
        public string Person
        {
            get
            {
                return this.m_Person;
            }
            set
            {
                this.m_Person = value;
            }
        }

        [DisplayName("Position"), Category("Column")]
        public string Position
        {
            get
            {
                return this.m_Position;
            }
            set
            {
                this.m_Position = value;
            }
        }

        public string ProductName
        {
            get
            {
                return "Class HRM_CANDIDATE_RATE";
            }
        }

        public string ProductVersion
        {
            get
            {
                return "1.0.0.0";
            }
        }

        [DisplayName("Proposal"), Category("Column")]
        public string Proposal
        {
            get
            {
                return this.m_Proposal;
            }
            set
            {
                this.m_Proposal = value;
            }
        }

        [Category("Column"), DisplayName("Rate")]
        public string Rate
        {
            get
            {
                return this.m_Rate;
            }
            set
            {
                this.m_Rate = value;
            }
        }

        [Category("Primary Key"), DisplayName("RateID")]
        public Guid RateID
        {
            get
            {
                return this.m_RateID;
            }
            set
            {
                this.m_RateID = value;
            }
        }

        [DisplayName("Situation"), Category("Column")]
        public string Situation
        {
            get
            {
                return this.m_Situation;
            }
            set
            {
                this.m_Situation = value;
            }
        }

        [Category("Column"), DisplayName("Solve")]
        public string Solve
        {
            get
            {
                return this.m_Solve;
            }
            set
            {
                this.m_Solve = value;
            }
        }

        [Category("Column"), DisplayName("Style")]
        public string Style
        {
            get
            {
                return this.m_Style;
            }
            set
            {
                this.m_Style = value;
            }
        }

        [Category("Column"), DisplayName("Team")]
        public string Team
        {
            get
            {
                return this.m_Team;
            }
            set
            {
                this.m_Team = value;
            }
        }

        [DisplayName("Voice"), Category("Column")]
        public string Voice
        {
            get
            {
                return this.m_Voice;
            }
            set
            {
                this.m_Voice = value;
            }
        }
    }
}

